package com.scau402.system1.domain.po;

import com.baomidou.mybatisplus.annotation.TableName;
import com.scau402.system1.utils.IdGenerator;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.math.BigDecimal;

/**
 * 盘点单翡翠详情
 */
@Data
@TableName("wms_checkbound_jade_detail")
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class WmsCheckboundJadeDetailPO {
    /**
     * 主键
     */
    private Long id;
    /**
     * 盘点单id
     */
    private Long checkOrderId;
    /**
     * 翡翠名称
     */
    private String name;
    /**
     * 条码
     */
    private String barcode;
    /**
     * 在仓数量
     */
    private Long totalNums;
    /**
     * 已盘点总量
     */
    private Long countNums;
    /**
     * 成本价
     */
    private BigDecimal costPrice;
    /**
     * 标签价
     */
    private BigDecimal tagPrice;
    /**
     * 市场价
     */
    private BigDecimal marketPrice;
    /**
     * 图片id
     */
    private Long imageId;
    /**
     * 仓库id
     */
    private Long warehouseId;
    /**
     * 仓位id
     */
    private Long storageId;

    public WmsCheckboundJadeDetailPO(IdGenerator idGenerator,Long checkOrderId,WmsJadePO jade){
        this.id = idGenerator.nextId("jadeDetail");
        this.checkOrderId = checkOrderId;
        this.name = jade.getJadeName();
        this.barcode = jade.getJadeBarcode();
        this.totalNums = jade.getJadeQuantity()-jade.getOutboundQuantity();
        this.countNums = 0L;
        this.costPrice = jade.getJadeCost();
        this.tagPrice = jade.getJadeTagPrice();
        this.marketPrice = jade.getJadeMarketPrice();
        this.imageId = jade.getImageId();
        this.warehouseId = jade.getWarehouseId();
        this.storageId = jade.getStorageId();
    }
}
